<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
</head>

<body>
    <div id='app'>
        <!-- 遍历数组 -->
        <ul>
            <!-- :key属性绑定一定伴随着v-for指令一起出现 -->
            <li v-for='(item,index) in arr' :key='item.id'>{{item.name}}</li>
        </ul>
        <!-- 遍历数字 -->
        <ol>
            <li v-for='item in 10'>{{item}}</li>
        </ol>
        <!-- 遍历字符串 -->
        <ol>
            <li v-for="item in 'abcd'">{{item}}</li>
        </ol>
        <!-- 遍历对象 -->
        <ul>
            <li v-for="(v,k,i) in obj">{{v}}---{{k}}---{{i}}</li>
        </ul>
    </div>
    <script src='../js/vue.js'></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                arr: [{
                    id: 0,
                    name: '老大'
                },
                {
                    id: 1,
                    name: '老二'
                },
                {
                    id: 2,
                    name: '老三'
                }],
                obj: {
                    name: '张三',
                    age: 20,
                    sex: '男'
                }
            },
            methods: {},
        })
    </script>
</body>

</html>